#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
const int N = 5e6 + 10;
int T, n;
char c[N];
int s[N];
int main()
{
    cin >> T;
    for (int t = 1; t <= T; t++)
    {
        cin >> n;
        int d = (n + 1) / 2, mi = 0;
        for (int i = 1; i <= n; i++)
        {
            cin >> c[i];
            s[i] = c[i] - '0';
            s[i] += s[i - 1];
            if (i >= d) mi = max(mi, s[i] - s[i - d]);
        }
        printf("Case #%d: %d\n", t, mi);
    }
    return 0;
}